﻿namespace Mysoft.MyCM
{
	using System;
	using System.Collections.Generic;
	using System.ComponentModel.DataAnnotations;
	using System.ComponentModel.DataAnnotations.Schema;
	using System.Data.Entity.Spatial;
	using System.Runtime.Serialization;

	/// <summary>
	/// WebApi 调用日志
	/// </summary>
	[DataContract]
	[Table("CMLog")]
	public class CMLog
	{
		/// <summary>
		/// Log Id
		/// </summary>
		[DataMember]
		public System.Guid Id { get; set; }
		/// <summary>
		/// 请求WebApi的客户端App
		/// </summary>
		[DataMember]
		[Required]
		public string FromApp { get; set; }
		/// <summary>
		/// 请求WebApi的使用客户端的用户
		/// </summary>
		[DataMember]
		[Required]
		[StringLength(100)]
		public string FromUser { get; set; }
		/// <summary>
		/// 请求WebApi的使用客户端用户客户机IP
		/// </summary>
		[DataMember]
		[Required]
		[StringLength(20)]
		public string FromIP { get; set; }
		/// <summary>
		/// 请求调用的WebApi动作
		/// </summary>
		[DataMember]
		[Required]
		public string CalledVerb { get; set; }
		/// <summary>
		/// 请求调用的WebApi地址
		/// </summary>
		[DataMember]
		[Required]
		public string CalledUrl { get; set; }
		/// <summary>
		/// 扩展信息
		/// </summary>
		[DataMember]
		[Required]
		public string Message { get; set; }
		/// <summary>
		/// 日志类型
		/// </summary>
		[DataMember]
		[StringLength(10)]
		public string Level { get; set; }
		/// <summary>
		/// 创建时间
		/// </summary>
		[DataMember]
		public DateTime CreateOn { get; set; }
	}
}
